package com.friends.utils.excel.easyexcel3.annotation;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.friends.utils.excel.easyexcel3.converter.LocalDateStringConverter;
import com.friends.utils.excel.easyexcel3.converter.LocalDateTimeStringConverter;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import java.time.LocalDateTime;

/**
 * <p>
 * <B>Description: 凭证表DTO</B>
 * </P>
 *
 * @version 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, fillBackgroundColor = 44) /*居中 表头背景颜色*/
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        borderLeft = BorderStyleEnum.THIN,
        borderRight = BorderStyleEnum.THIN,
        borderBottom = BorderStyleEnum.THIN,
        borderTop = BorderStyleEnum.THIN
)/*居中，边框样式*/
public class VoucherExcelExportDTO implements Cloneable {


    /**
     * 凭证号
     */
    @ExcelProperty(value = "凭证号",index = 0)
    private Integer voucherNo;
    /**
     * oaNo
     */
    @ExcelProperty(value = "流程编号",index = 1)
    private String oaNo;
    /**
     * 标题
     */
    @ExcelProperty(value = "标题",index = 2)
    private String title;

    /**
     * 摘要
     */
    @ExcelProperty(value = "摘要",index = 3)
    private String detailRemark;

    /**
     * 科目
     */
    @ExcelProperty(value = "科目",index = 4)
    private String subject;

    /**
     * 辅助核算
     */
    @ExcelProperty(value = "辅助核算",index = 5)
    private String accasses;
    /**
     * 制单人(操作人)
     */
    @ExcelProperty(value = "操作人",index = 6)
    private String preparedBy;

    /**
     * 制单日期
     */
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "制单日期",index = 7,converter = LocalDateStringConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime voucherTime;

    /**
     * 协同发起人
     */
    @ExcelProperty(value = "协同发起人",index = 8)
    private String createdBy;
    /**
     * 协同发起时间
     */
    @ExcelProperty(value = "协同发起时间",index = 9,converter = LocalDateTimeStringConverter.class)
    @DateTimeFormat("yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime createdTime;
    
    /**
     * 审核日期
     */
    @ExcelProperty(value = "审核日期",index = 10,converter = LocalDateTimeStringConverter.class)
    @DateTimeFormat("yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime auditTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注",index = 11)
    private String remark;

    @Override
    public VoucherExcelExportDTO clone() {
        try {
            VoucherExcelExportDTO clone = (VoucherExcelExportDTO) super.clone();
            // TODO: copy mutable state here, so the clone can't change the internals of the original
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }
}